//
//  Device.m
//  jiulongLJ
//
//  Created by MyMac on 15/4/2.
//  Copyright (c) 2015年 MyMac. All rights reserved.
//

#import "Device.h"

@implementation Device
+(CGSize)currentDeviceScreen
{
    return [UIScreen mainScreen].bounds.size;
  
}
+(CGFloat)deviceVersion
{
    UIDevice*device=[UIDevice currentDevice];
    return  [device.systemVersion floatValue];

}
+(CGSize)deviceTitle:(NSString *)text andNeedfontDict:(NSDictionary *)fontDict andmaxSize:(CGSize)maxSize
{

    if([Device deviceVersion]>7.0){
        CGRect rect=[text boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:fontDict context:nil];
        return rect.size;
    }else{
        CGSize size=[text sizeWithFont:[UIFont systemFontOfSize:15] forWidth:maxSize.width lineBreakMode:NSLineBreakByWordWrapping];
        return size;
        
    }









}


@end
